package com.dmzc.stage3.AQS;

import java.util.concurrent.locks.LockSupport;

public class Test6 {
    public static void main(String[] args) {
        Thread t1 = new Thread("thread1") {
            @Override
            public void run() {
                System.out.println("thread1 park before");
                LockSupport.park();
                System.out.println("thread1 park after");
            }
        };
        Thread t2 = new Thread("thread2") {
            @Override
            public void run() {
                System.out.println("thread2 unpark before");
                LockSupport.unpark(t1);
            }
        };
    }
}
